#import <UIKit/UIKit.h>

#import "BGHttpConstant.h"
#import "BGEnumConstant.h"
#import "BGColorFontConstant.h"
#import "BGNotificationConstant.h"

//***--------- 常量 -----------**************

//UIKIT_EXTERN NSString *const BGAppLanguageKey;
//UIKIT_EXTERN NSString *const BGAppLanguageFollowSystem;

UIKIT_EXTERN const NSInteger BGAllInset;
UIKIT_EXTERN const NSInteger BGAllMargin;
UIKIT_EXTERN const CGFloat BGDetailToolBarHeight;


//***--------- 常量 -----------**************

//日志输出
#ifdef DEBUG //开发阶段
#define BGLog(...) NSLog(__VA_ARGS__)
#define NSLog(...) NSLog(__VA_ARGS__)
#else //发布阶段
#define BGLog(...)
#define NSLog(...)
#endif


// 语言环境设置相关
#define BGAppLanguageKey @"appLanguage"
#define BGAppLanguageFollowSystem @"followSystem"
#define BGAppLanguage [[NSUserDefaults standardUserDefaults] objectForKey:BGAppLanguageKey]
#define BGLocalizedString(key) ([BGAppLanguage isEqualToString:BGAppLanguageFollowSystem]) ? NSLocalizedString(key, nil) : ([[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@", BGAppLanguage] ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:nil])


#define kWINDOW     [UIApplication sharedApplication].keyWindow
#define BGAppDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate)
//硬件识别
#define SCREEN_WIDTH    ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT   ([UIScreen mainScreen].bounds.size.height)
#define BGBigCellImageWidth SCREEN_WIDTH - 2 * BGAllInset //大图的宽和高
#define BGBigCellImageHeight (9 * BGBigCellImageWidth) / 16

//设备型号识别
#define is_IOS_7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define is_IOS_8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
#define is_IOS_9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)

#define StatusbarSize ((is_IOS_7 && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1)?20.f:0.f)

//适配 iphone4  iphone5
#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640,960), [[UIScreen mainScreen] currentMode].size) : NO)
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640,1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750,1334), [[UIScreen mainScreen] currentMode].size) : NO)
#define iPhone6plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242,2208), [[UIScreen mainScreen] currentMode].size) : NO)

